.piclist-settings {
  padding: 1.5rem;
  min-height: 100vh;
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.piclist-settings::-webkit-scrollbar {
  display: none;
}

/* Header */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-icon {
  color: var(--color-accent);
}

.settings-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.settings-header p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background: var(--color-background-primary);
  border-radius: 12px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border);
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.tab-button:hover {
  color: var(--color-text-primary);
  background: var(--color-background-primary);
}

.tab-button.active {
  background: #409eff;
  color: white;
  box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
}

/* Settings Content */
.settings-content {
  display: flex;
  flex-direction: column;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section {
  background: var(--color-background-primary);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--color-border);
  border: 1px solid var(--color-border);
}

.settings-section h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.settings-section p {
  margin: 0 0 1.5rem 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group > label:not(.switch-label):not(.radio-option) {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-blue-common);
  box-shadow: 0 0 0 2px var(--el-color-primary-light-9, rgba(64, 158, 255, 0.2));
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e4e7ed;
  outline: none;
  margin-bottom: 0.5rem;
  -webkit-appearance: none;
  appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #409eff;
  cursor: pointer;
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #409eff;
  cursor: pointer;
  border: none;
}

.range-value {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}

/* Grid Layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Switch Component */
.switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 1rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: 8px;
  background: var(--color-background-tertiary);
  transition: all 0.2s ease;
}

.switch-label:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

.switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 12px;
  transition: background-color 0.3s;
  flex-shrink: 0;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.switch-input:checked + .switch-slider {
  background: #409eff;
}

.switch-input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch-content {
  flex: 1;
}

.switch-title {
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.switch-description {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: 8px;
  background: var(--color-background-tertiary);
  transition: all 0.2s ease;
}

.radio-option:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

.radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-indicator {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  flex-shrink: 0;
}

.radio-input:checked + .radio-indicator {
  border-color: #409eff;
}

.radio-input:checked + .radio-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #409eff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.radio-label {
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: fit-content;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: #409eff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #66b1ff;
}

.btn-secondary {
  background: var(--color-background-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-background-secondary);
}

.btn-danger {
  background: #f56c6c;
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #f78989;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: 6px;
  background: var(--color-background-tertiary);
  transition: all 0.2s ease;
}

.checkbox-option:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-indicator {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
}

.checkbox-input:checked + .checkbox-indicator {
  background: #409eff;
  border-color: #409eff;
}

.checkbox-input:checked + .checkbox-indicator::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  color: white;
  font-size: 10px;
  transform: translate(-50%, -50%);
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

/* Input Groups */
.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group .form-input {
  flex: 1;
}

.input-addon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-background-tertiary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.input-addon-btn:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
}

/* Dialog Overlay */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dialog {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  max-width: 90vw;
  width: 80vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dialog-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.dialog-close:hover {
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
}

.dialog-content {
  margin-bottom: 1.5rem;
  padding: 0.2rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dialog-content::-webkit-scrollbar {
  display: none;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.button-group {
  display: flex;
  gap: 0.75rem;
}

.button-group .btn {
  flex: 1;
}

/* Notice Text */
.notice-text {
  background: rgba(0, 128, 255, 0.1);
  color: #1c2630ff;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.925rem;
}

/* Small text */
small {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .piclist-settings {
    padding: 1rem;
  }
  
  .tab-navigation {
    flex-direction: column;
  }
  
  .tab-button {
    justify-content: flex-start;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .dialog {
    width: 95%;
    margin: 1rem;
  }
}

/* Dark mode adjustments */
:root.dark .piclist-settings,
:root.auto.dark .piclist-settings {
  background: var(--color-background-secondary);
}

:root.dark .settings-header,
:root.dark .tab-navigation,
:root.dark .settings-section,
:root.auto.dark .settings-header,
:root.auto.dark .tab-navigation,
:root.auto.dark .settings-section {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
}

:root.dark .form-input,
:root.dark .form-textarea,
:root.dark .form-select,
:root.auto.dark .form-input,
:root.auto.dark .form-textarea,
:root.auto.dark .form-select {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

:root.dark .switch-slider::before,
:root.auto.dark .switch-slider::before {
  background: var(--color-surface);
}

:root.dark .btn-secondary,
:root.auto.dark .btn-secondary {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

:root.dark .btn-secondary:hover,
:root.auto.dark .btn-secondary:hover {
  background: var(--color-background-secondary);
}

:root.dark .switch-label,
:root.auto.dark .switch-label {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
}

:root.dark .switch-label:hover,
:root.auto.dark .switch-label:hover {
  background: var(--color-background-secondary);
}

:root.dark .radio-option,
:root.dark .checkbox-option,
:root.auto.dark .radio-option,
:root.auto.dark .checkbox-option {
  background: var(--color-background-tertiary);
  border-color: var(--color-border);
}

:root.dark .radio-option:hover,
:root.dark .checkbox-option:hover,
:root.auto.dark .radio-option:hover,
:root.auto.dark .checkbox-option:hover {
  background: var(--color-background-secondary);
}

:root.dark .dialog,
:root.auto.dark .dialog {
  background: var(--color-background-tertiary);
}

/* Placeholder Help Styles */
.placeholder-help {
  background: var(--color-background-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0;
  margin-top: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.placeholder-category {
  border-bottom: 1px solid var(--color-border-light);
}

.placeholder-category:last-child {
  border-bottom: none;
}

.category-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 0.875rem 1rem 0.5rem;
  background: linear-gradient(135deg, var(--color-background-secondary) 0%, var(--color-background-tertiary) 100%);
  border-bottom: 1px solid var(--color-border-light);
  margin: 0;
  letter-spacing: 0.02em;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  padding: 0.5rem 0;
}

.placeholder-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 0;
  margin: 0;
}

.placeholder-item:hover {
  background: rgba(var(--color-accent-rgb), 0.08);
}

.placeholder-item code {
  background: var(--color-blue-common);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  margin-right: 0.875rem;
  min-width: 80px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.placeholder-item span {
  color: var(--color-text-primary);
  font-weight: 500;
  flex: 1;
}

/* Scrollbar styling for macOS feel */
.placeholder-help::-webkit-scrollbar {
  width: 6px;
}

.placeholder-help::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.placeholder-help::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.placeholder-help::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* Dark theme adjustments */
:root.dark .placeholder-help,
:root.auto.dark .placeholder-help {
  background: var(--color-background-secondary);
  border-color: var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

:root.dark .category-title,
:root.auto.dark .category-title {
  background: linear-gradient(135deg, var(--color-background-tertiary) 0%, var(--color-background-secondary) 100%);
  border-bottom-color: var(--color-border);
}

:root.dark .placeholder-category,
:root.auto.dark .placeholder-category {
  border-bottom-color: var(--color-border);
}

:root.dark .placeholder-item:hover,
:root.auto.dark .placeholder-item:hover {
  background: rgba(var(--color-accent-rgb), 0.12);
}

:root.dark .placeholder-item code,
:root.auto.dark .placeholder-item code {
  background: var(--color-blue-common);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Update info and Release Notes Styles */
.update-info {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-background);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.update-info > div {
  margin-bottom: 0.5rem;
  font-size: 0.925rem;
}

.update-info > div:last-child {
  margin-bottom: 0;
}

.update-notice {
  color: var(--color-success) !important;
  font-weight: 500;
}

/* Release Notes Card */
.release-notes-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.release-notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

.release-notes-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.release-notes-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  min-height: auto;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--color-accent);
  text-decoration: underline;
  padding: 0.25rem;
}

.btn-link:hover {
  color: var(--color-accent-hover);
  background: transparent;
}

.release-notes-content {
  background: var(--color-background);
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) transparent;
}

.release-notes-content::-webkit-scrollbar {
  width: 6px;
}

.release-notes-content::-webkit-scrollbar-track {
  background: transparent;
}

.release-notes-content::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 3px;
}

.release-notes-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-hover);
}

.release-notes-loading,
.release-notes-error,
.release-notes-empty {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.925rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.release-notes-error {
  color: var(--color-error);
  flex-direction: column;
  gap: 1rem;
}

.release-notes-text {
  padding: 0;
}

.release-notes-pre {
  margin: 0;
  padding: 1.5rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--color-text-primary);
  background: transparent;
  border: none;
}

.release-notes-footer {
  padding: 0.75rem 1.5rem;
  background: var(--color-background-secondary);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.release-notes-footer small {
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

/* Rotation animation for loading icons */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate {
  animation: rotate 1s linear infinite;
}
